package com.ddwl.gate.controller;

import com.ddwl.common.annotation.Auth;
import com.ddwl.common.constant.GateEnum;
import com.ddwl.common.controller.BaseController;
import com.ddwl.gate.service.DictionaryService;
import com.ddwl.schema.vo.base.RestVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "搜索关键字")
@RequestMapping("/keyword")
@RestController
@RequiredArgsConstructor
public class KeywordController extends BaseController {

    private final DictionaryService dictionaryService;


    @GetMapping("/item")
    @ApiOperation("商品推荐关键字")
    @Auth(required = false)
    public RestVo item() {
        return RestVo.ok(dictionaryService.getSettingVal(GateEnum.DictionaryTag.TAG_SYSTEM.name(), GateEnum.DictionaryField.ITEM_KEYWORD.name()));
    }

    @GetMapping("/shop")
    @ApiOperation("商品推荐关键字")
    @Auth(required = false)
    public RestVo shop() {
        return RestVo.ok(dictionaryService.getSettingVal(GateEnum.DictionaryTag.TAG_SYSTEM.name(), GateEnum.DictionaryField.SHOP_KEYWORD.name()));
    }
}
